import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'


// vite.config.js
export default defineConfig({
  plugins: [vue()],
  resolve: {
    extensions: ['.js', '.vue', '.json'] // 显式声明扩展名
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://localhost:8070',  // 后端地址
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, '')
      }
    }
  }
})
